import React from 'react';
import {Menu} from "antd";
import {UserOutlined} from "@ant-design/icons";
import {NavLink, Redirect, Route, Switch} from "react-router-dom";
import LandMarket from "../../pages/WorkSite/LandMarket/LandMarket";
import MacroAna from "../../pages/WorkSite/MacroAna/MacroAna";
import ViewTemplate from "../../pages/components/ViewTemplate/ViewTemplate";
import {left_menu_work} from '../../config/menus'
import Business from "../../pages/WorkSite/Business/Business";
import CityMap from "../../pages/WorkSite/CityMap/CityMap";
export default (props)=>{
	let {pathname}=props.location;
	return (
		<ViewTemplate pathname={pathname}>
			<Menu.ItemGroup icon={<UserOutlined />} title="工作站">
				{
					left_menu_work.map(item=><Menu.Item key={item.to}><NavLink to={item.to}>{item.title}</NavLink></Menu.Item>)
				}
			</Menu.ItemGroup>
			<Switch>
				<Route exact path="/work" component={LandMarket} />
				<Route exact path="/work/macro" component={MacroAna} />
				<Route exact path="/work/business" component={Business} />
				<Route exact path="/work/cityMap" component={CityMap} />
				<Redirect to={{ pathname: "/work" }} />
			</Switch>
		</ViewTemplate>
	);
}
